<?php
//Return arrival / departure places array of Thong Nhat train 

define('THONG_NHAT', 'tn');
define('SAPA_TRAINS', 'sapa');

function _get_destination_array($type) {
  if($type == THONG_NHAT) {
    return array(
      'hn' => 'Hanoi',
      'nb' => 'Ninh Binh',
      'hu' => 'Hue',
      'dn' => 'Da Nang',
      'dt' => 'Dieu Tri',
      'nt' => 'Nha Trang',
      'mm' => 'Muong Man',
      'pt' => 'Phan Thiet',
      'hcm' => 'Ho Chi Minh City',
    );
  } else {
    return array(
      'hn' => 'Hanoi',
      'sp' => 'Sapa',
    );
  }
}

function _get_trains($key) {
	switch ($key) {
		case SAPA_TRAINS:
			return 'SAPA';
		default:
			return 'THỐNG NHẤT';
	}
}

function _get_sapa_chirld() {
	return array(
      'spe' => 'Sapaly Express Train',
      'hre' => 'Hara Express Train',
      'pu' => 'Pumpkin Train',
      'tu' => 'Tulico Train',
      'vt' => 'Victoria Express Train',
      'lvi' => 'Livitrans Train',
      'tsc' => 'TSC Train',
      'fane' => 'Fanxipan Express Train',
      'orie' => 'Orient Express Train',
    );
}

function _get_class_type_array() {
  return array('Hard seat', 'Soft seat', 'Hard berth', 'Soft berth');
}

function _get_journey_type_array() {
  return array('One way', 'Two way');
}

function _get_person_quantity_array() {
  $return = array();
  for($i = 0; $i < 11; $i++) {
    array_push($return, $i);
  }
  
  return $return;
}

function _breadcrumb($title) {
  $breadcrumbs = array('Search', 'Schedule', 'Passenger Info', 'Confirmation', 'Payment');
  
  $output = '<div id="vntrains-breadcrumb-wrapper-wrapper"><div id="vntrains-breadcrumb-wrapper">';
  foreach($breadcrumbs as $key => $breadcrumb) {
    if($key == $title) {
      $output .= '<div id="breadcrumb' . $key . '" class="vntrains-breadcrumb current">' . $breadcrumb . '</div>';
    } else {
      $output .= '<div id="breadcrumb' . $key . '" class="vntrains-breadcrumb">' . $breadcrumb . '</div>';
    }
  }
  $output .= '</div></div>';
  
  return $output;
}

function _format_date_array($time) {
  return array(
    'year' => date('Y', $time),
    'month' => date('m', $time),
    'day' => date('d', $time),
  );
}